var ip = undefined;

$(document).ready(function() {
    getIP();
});

function getIP(){
    ip = window.control.readFiles() || "-";
    var stationStage = window.control.readStation() || "-";
    $("#ipAddress").val(ip);
    $("#stationStage").val(stationStage);
}

function modify() {
    ip = $("#ipAddress").val();
    var resule = window.control.writeFiles(ip);
    if(resule == "success") {
    	getIP();
    } else {
    	$("#ipAddress").val("");
    }
}

function changeStage() {
    var stationStage = $("#stationStage").val();
    var resule = window.control.writeStation(stationStage);
    if(resule == "success") {
        $("#stationStage").val(stationStage);
    } else {
        $("#stationStage").val("");
    }
}